<template>
	<view class="main">
		<u-navbar :is-back="true" title="设置" :background="background" :border-bottom="false" title-color="#fff"
			title-size="35rpx" title-bold="true" back-icon-color="#fff">
		</u-navbar>
		<view class="content">
			<view class="info" v-for="user,index in info" :key="index" @click="router(user.path)">
				<view class="left">
					<image :src="user.image" mode="aspectFit"></image>
					<text>{{user.title}}</text>
				</view>
				<view class="right">
					<image src="../../../static/images/goright.png" mode=""></image>
				</view>
			</view>
		</view>
		<view class="content">
			<view class="info" v-for="item,index in agreement" :key="index" @click="router(item.path)">
				<view class="left">
					<image :src="item.image" mode="aspectFit"></image>
					<text>{{item.title}}</text>
				</view>
				<view class="right">
					<image src="../../../static/images/goright.png" mode=""></image>
				</view>
			</view>
		</view>
		<view class="btn" @click="clear">
			退出登录
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				background: {
					backgroundColor: '#111111',
					// background: 'url(https://cdn.uviewui.com/uview/swiper/1.jpg) no-repeat',
				},
				info: [{
						title: '个人资料',
						image: '../../../static/images/mine.png',
						path: '../personal/personal'
					},
					{
						title: '账号安全',
						image: '../../../static/images/safe.png',
						path: '../set_password/set_password'
					},
					{
						title: '我的客服',
						image: '../../../static/images/kefu.png',
						// path:'../set_password/set_password'
					},
					{
						title: '关于我们',
						image: '../../../static/images/about.png',
						path: '../about/about'
					},

				],
				agreement: [{
						title: '用户协议',
						image: '../../../static/images/xieyi.png',
						path: '../agreement/agreement'
					},
					{
						title: '隐私政策',
						image: '../../../static/images/yinsi.png',
						path: '../privacy/privacy'
					}

				]
			}
		},
		methods: {
			clear() {
				uni.clearStorage()
				uni.showToast({
					title: '退出成功',
					icon: "none",
					mask: true,
					duration: 2000
				})
				setTimeout(function() {
					uni.switchTab({
						url: '../../indexs/index/index'
					})
				}, 2000)
			},
			router(path) {
				console.log(path);
				uni.navigateTo({
					url: path,
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		font-family: PingFang SC-Regular, PingFang SC;
		background-color: #111111;

		width: 750rpx;

		.main {
			display: flex;
			flex-direction: column;
			align-items: center;

			.content {
				margin: 22rpx 0rpx;
				width: 686rpx;
				background: #181818;
				border-radius: 32rpx;
				opacity: 1;

				.info {
					display: flex;
					justify-content: space-between;
					border-bottom: 2rpx solid #262626;
					padding: 32rpx 0;
					margin: 0 24rpx;

					.left {
						image {
							width: 48rpx;
							height: 48rpx;
							padding-right: 16rpx;
						}

						display: flex;
						align-items: center;
						font-size: 32rpx;
						font-weight: 400;
						color: #FFFFFF;
					}

					.right {

						image {
							width: 24rpx;
							height: 24rpx;
						}
					}
				}

				.info:last-child {
					border: none;
				}

			}

			.btn {
				margin-top: 60rpx;
				padding: 24rpx 96rpx;
				background: #F3C860;
				border-radius: 46rpx;
				opacity: 1;
				font-size: 32rpx;
				font-weight: bold;
				color: #333333;
			}
		}
	}
</style>
